<%@ page contentType="text/html;charset=UTF-8" %>

<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <title>Register New User</title>
</head>
<body>

<div class="section">
  <h1>Register</h1>
</div>

<div class="section">
  <g:form url="[action:'doRegister']">
    <fieldset>
      <div class="entry">
        <div class="label"><label>Username:</label></div>
        <div class="input ${hasErrors(bean: user, field: 'username', 'errors')}">
          <input type="text" name="username" value="${params.username}" />
          <div id="usernameErrors" class="errors">
            <g:renderErrors bean="${user}" as="list" field="username" />
          </div>
        </div>
      </div>

      <div class="entry">
        <div class="label"><label>Real Name:</label></div>
        <div class="input ${hasErrors(bean: user, field: 'name', 'errors')}">
          <input type="text" name="name" value="${params.name}" />
          <div id="nameErrors" class="errors">
            <g:renderErrors bean="${user}" as="list" field="name" />
          </div>
        </div>
      </div>

      <div class="entry">
        <div class="label"><label>Password:</label></div>
        <div class="input ${hasErrors(bean: user, field: 'password', 'errors')}">
          <input type="password" name="password" value="" />
          <div id="passwordErrors" class="errors">
            <g:renderErrors bean="${user}" as="list" field="password" />
          </div>
        </div>
      </div>

      <div class="entry">
        <div class="label"><label>Verify Password:</label></div>
        <div class="input ${hasErrors(bean: user, field: 'verify', 'errors')}">
          <input type="password" name="verify" />
          <div id="verifyErrors" class="errors">
            <g:renderErrors bean="${user}" as="list" field="verify" />
          </div>
        </div>
      </div>

      <div class="entry">
        <div class="label">&#160;</div>
        <div class="input">
          <input type="submit" value="Register"/>&#160;
          <input type="button" value="Cancel" onclick="window.location.href = '${createLinkTo('/')}'"/>
        </div>
      </div>
    </fieldset>
  </g:form>
</div>
</body>
</html>